package com.woniu.controller;

import com.woniu.entity.PageResult;
import com.woniu.entity.Result;
import com.woniu.pojo.Rate;
import com.woniu.service.IRateService;
import com.woniu.vo.GoodsVo;
import com.woniu.vo.RateVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tanMax
 * @since 2022-10-14
 */
@RestController
@RequestMapping("/rate")
@Api(tags = "评价管理")
public class RateController extends BaseController{
    @Autowired
    private IRateService rateService;

    @PostMapping("/search/{currentPage}/{pageSize}")
    public Result search(@RequestBody RateVo rateVo, @PathVariable Integer currentPage, @PathVariable Integer pageSize){
        PageResult list = rateService.search(rateVo,currentPage,pageSize);
        return toDataResult(list);
    }
}
